Imports TBVLibrary
Imports TBVLibrary.LibDataType
Imports TBVLibrary.Library


Public Class frmInventory
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents uTab As Infragistics.Win.UltraWinTabControl.UltraTabControl
    Friend WithEvents UltraTabSharedControlsPage1 As Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage
    Friend WithEvents UltraTabPageControl1 As Infragistics.Win.UltraWinTabControl.UltraTabPageControl
    Friend WithEvents UltraTabPageControl2 As Infragistics.Win.UltraWinTabControl.UltraTabPageControl
    Friend WithEvents Panel1 As System.Windows.Forms.Panel
    Friend WithEvents Panel2 As System.Windows.Forms.Panel
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents txtOS As TBVLibrary.TextBoxCustom
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents txtVersion As TBVLibrary.TextBoxCustom
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents txtManucfacturer As TBVLibrary.TextBoxCustom
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents txtSerial As TBVLibrary.TextBoxCustom
    Friend WithEvents Label5 As System.Windows.Forms.Label
    Friend WithEvents txtFreeMem As TBVLibrary.TextBoxCustom
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents txtLocale As TBVLibrary.TextBoxCustom
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim UltraTab1 As Infragistics.Win.UltraWinTabControl.UltraTab = New Infragistics.Win.UltraWinTabControl.UltraTab
        Dim UltraTab2 As Infragistics.Win.UltraWinTabControl.UltraTab = New Infragistics.Win.UltraWinTabControl.UltraTab
        Me.UltraTabPageControl1 = New Infragistics.Win.UltraWinTabControl.UltraTabPageControl
        Me.Panel1 = New System.Windows.Forms.Panel
        Me.txtFreeMem = New TBVLibrary.TextBoxCustom
        Me.Label5 = New System.Windows.Forms.Label
        Me.Label4 = New System.Windows.Forms.Label
        Me.txtSerial = New TBVLibrary.TextBoxCustom
        Me.txtManucfacturer = New TBVLibrary.TextBoxCustom
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.txtVersion = New TBVLibrary.TextBoxCustom
        Me.Label1 = New System.Windows.Forms.Label
        Me.txtOS = New TBVLibrary.TextBoxCustom
        Me.UltraTabPageControl2 = New Infragistics.Win.UltraWinTabControl.UltraTabPageControl
        Me.Panel2 = New System.Windows.Forms.Panel
        Me.uTab = New Infragistics.Win.UltraWinTabControl.UltraTabControl
        Me.UltraTabSharedControlsPage1 = New Infragistics.Win.UltraWinTabControl.UltraTabSharedControlsPage
        Me.Label6 = New System.Windows.Forms.Label
        Me.txtLocale = New TBVLibrary.TextBoxCustom
        Me.UltraTabPageControl1.SuspendLayout()
        Me.Panel1.SuspendLayout()
        Me.UltraTabPageControl2.SuspendLayout()
        CType(Me.uTab, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.uTab.SuspendLayout()
        Me.SuspendLayout()
        '
        'UltraTabPageControl1
        '
        Me.UltraTabPageControl1.Controls.Add(Me.Panel1)
        Me.UltraTabPageControl1.Location = New System.Drawing.Point(1, 23)
        Me.UltraTabPageControl1.Name = "UltraTabPageControl1"
        Me.UltraTabPageControl1.Size = New System.Drawing.Size(780, 430)
        '
        'Panel1
        '
        Me.Panel1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Panel1.BackColor = System.Drawing.Color.Lavender
        Me.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Panel1.Controls.Add(Me.Label6)
        Me.Panel1.Controls.Add(Me.txtLocale)
        Me.Panel1.Controls.Add(Me.txtFreeMem)
        Me.Panel1.Controls.Add(Me.Label5)
        Me.Panel1.Controls.Add(Me.Label4)
        Me.Panel1.Controls.Add(Me.txtSerial)
        Me.Panel1.Controls.Add(Me.txtManucfacturer)
        Me.Panel1.Controls.Add(Me.Label3)
        Me.Panel1.Controls.Add(Me.Label2)
        Me.Panel1.Controls.Add(Me.txtVersion)
        Me.Panel1.Controls.Add(Me.Label1)
        Me.Panel1.Controls.Add(Me.txtOS)
        Me.Panel1.ForeColor = System.Drawing.Color.Black
        Me.Panel1.Location = New System.Drawing.Point(1, 1)
        Me.Panel1.Name = "Panel1"
        Me.Panel1.Size = New System.Drawing.Size(782, 428)
        Me.Panel1.TabIndex = 0
        '
        'txtFreeMem
        '
        Me.txtFreeMem.FocusedBackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.txtFreeMem.FocusedForeColor = System.Drawing.Color.Black
        Me.txtFreeMem.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtFreeMem.Location = New System.Drawing.Point(129, 207)
        Me.txtFreeMem.Name = "txtFreeMem"
        Me.txtFreeMem.Size = New System.Drawing.Size(181, 21)
        Me.txtFreeMem.TabIndex = 11
        Me.txtFreeMem.Text = ""
        '
        'Label5
        '
        Me.Label5.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label5.Location = New System.Drawing.Point(8, 206)
        Me.Label5.Name = "Label5"
        Me.Label5.Size = New System.Drawing.Size(122, 23)
        Me.Label5.TabIndex = 12
        Me.Label5.Text = "Free Physical Memory :"
        Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label4
        '
        Me.Label4.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label4.Location = New System.Drawing.Point(8, 67)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(120, 23)
        Me.Label4.TabIndex = 10
        Me.Label4.Text = "Serial Number :"
        Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'txtSerial
        '
        Me.txtSerial.FocusedBackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.txtSerial.FocusedForeColor = System.Drawing.Color.Black
        Me.txtSerial.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtSerial.Location = New System.Drawing.Point(129, 68)
        Me.txtSerial.Name = "txtSerial"
        Me.txtSerial.Size = New System.Drawing.Size(181, 21)
        Me.txtSerial.TabIndex = 9
        Me.txtSerial.Text = ""
        '
        'txtManucfacturer
        '
        Me.txtManucfacturer.FocusedBackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.txtManucfacturer.FocusedForeColor = System.Drawing.Color.Black
        Me.txtManucfacturer.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtManucfacturer.Location = New System.Drawing.Point(129, 39)
        Me.txtManucfacturer.Name = "txtManucfacturer"
        Me.txtManucfacturer.Size = New System.Drawing.Size(244, 21)
        Me.txtManucfacturer.TabIndex = 7
        Me.txtManucfacturer.Text = ""
        '
        'Label3
        '
        Me.Label3.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label3.Location = New System.Drawing.Point(129, 38)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(102, 23)
        Me.Label3.TabIndex = 8
        Me.Label3.Text = "Manufacturer :"
        Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'Label2
        '
        Me.Label2.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label2.Location = New System.Drawing.Point(8, 38)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(120, 23)
        Me.Label2.TabIndex = 6
        Me.Label2.Text = "Version :"
        Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'txtVersion
        '
        Me.txtVersion.FocusedBackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.txtVersion.FocusedForeColor = System.Drawing.Color.Black
        Me.txtVersion.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtVersion.Location = New System.Drawing.Point(129, 39)
        Me.txtVersion.Name = "txtVersion"
        Me.txtVersion.Size = New System.Drawing.Size(95, 21)
        Me.txtVersion.TabIndex = 5
        Me.txtVersion.Text = ""
        '
        'Label1
        '
        Me.Label1.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.Location = New System.Drawing.Point(8, 9)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(120, 23)
        Me.Label1.TabIndex = 3
        Me.Label1.Text = "Operating System :"
        Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'txtOS
        '
        Me.txtOS.FocusedBackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.txtOS.FocusedForeColor = System.Drawing.Color.Black
        Me.txtOS.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtOS.Location = New System.Drawing.Point(129, 10)
        Me.txtOS.Name = "txtOS"
        Me.txtOS.Size = New System.Drawing.Size(623, 21)
        Me.txtOS.TabIndex = 2
        Me.txtOS.Text = ""
        '
        'UltraTabPageControl2
        '
        Me.UltraTabPageControl2.Controls.Add(Me.Panel2)
        Me.UltraTabPageControl2.Location = New System.Drawing.Point(-10000, -10000)
        Me.UltraTabPageControl2.Name = "UltraTabPageControl2"
        Me.UltraTabPageControl2.Size = New System.Drawing.Size(780, 430)
        '
        'Panel2
        '
        Me.Panel2.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.Panel2.BackColor = System.Drawing.Color.Lavender
        Me.Panel2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
        Me.Panel2.ForeColor = System.Drawing.Color.Black
        Me.Panel2.Location = New System.Drawing.Point(1, 1)
        Me.Panel2.Name = "Panel2"
        Me.Panel2.Size = New System.Drawing.Size(782, 428)
        Me.Panel2.TabIndex = 1
        '
        'uTab
        '
        Me.uTab.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.uTab.BackColor = System.Drawing.SystemColors.Control
        Me.uTab.Controls.Add(Me.UltraTabSharedControlsPage1)
        Me.uTab.Controls.Add(Me.UltraTabPageControl1)
        Me.uTab.Controls.Add(Me.UltraTabPageControl2)
        Me.uTab.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.uTab.Location = New System.Drawing.Point(6, 6)
        Me.uTab.MultiRowSelectionStyle = Infragistics.Win.UltraWinTabs.MultiRowSelectionStyle.HighlightTab
        Me.uTab.Name = "uTab"
        Me.uTab.SharedControlsPage = Me.UltraTabSharedControlsPage1
        Me.uTab.Size = New System.Drawing.Size(784, 456)
        Me.uTab.TabIndex = 1
        Me.uTab.TabLayoutStyle = Infragistics.Win.UltraWinTabs.TabLayoutStyle.SingleRowJustified
        Me.uTab.TabPadding = New System.Drawing.Size(40, 1)
        UltraTab1.TabPage = Me.UltraTabPageControl1
        UltraTab1.Text = "System Summary"
        UltraTab2.TabPage = Me.UltraTabPageControl2
        UltraTab2.Text = "Networking"
        Me.uTab.Tabs.AddRange(New Infragistics.Win.UltraWinTabControl.UltraTab() {UltraTab1, UltraTab2})
        '
        'UltraTabSharedControlsPage1
        '
        Me.UltraTabSharedControlsPage1.Location = New System.Drawing.Point(-10000, -10000)
        Me.UltraTabSharedControlsPage1.Name = "UltraTabSharedControlsPage1"
        Me.UltraTabSharedControlsPage1.Size = New System.Drawing.Size(780, 430)
        '
        'Label6
        '
        Me.Label6.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label6.Location = New System.Drawing.Point(8, 104)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(120, 23)
        Me.Label6.TabIndex = 14
        Me.Label6.Text = "Locale :"
        Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
        '
        'txtLocale
        '
        Me.txtLocale.FocusedBackColor = System.Drawing.Color.FromArgb(CType(255, Byte), CType(255, Byte), CType(192, Byte))
        Me.txtLocale.FocusedForeColor = System.Drawing.Color.Black
        Me.txtLocale.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.txtLocale.Location = New System.Drawing.Point(128, 105)
        Me.txtLocale.Name = "txtLocale"
        Me.txtLocale.Size = New System.Drawing.Size(181, 21)
        Me.txtLocale.TabIndex = 13
        Me.txtLocale.Text = ""
        '
        'frmInventory
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 14)
        Me.ClientSize = New System.Drawing.Size(794, 468)
        Me.Controls.Add(Me.uTab)
        Me.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Name = "frmInventory"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "System Inventory"
        Me.UltraTabPageControl1.ResumeLayout(False)
        Me.Panel1.ResumeLayout(False)
        Me.UltraTabPageControl2.ResumeLayout(False)
        CType(Me.uTab, System.ComponentModel.ISupportInitialize).EndInit()
        Me.uTab.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region


    Private Sub uTab_SelectedTabChanged(ByVal sender As System.Object, ByVal e As Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs) Handles uTab.SelectedTabChanged
        If uTab.Tabs(0).Selected Then
            Call showInformation()
        ElseIf uTab.Tabs(1).Selected Then
            Call showNetworking()
        End If
    End Sub

    Private Sub showNetworking()

        Dim objComputer As Computer
        Dim classComputer As New classComputer
        Dim typeStatus As STATUS_CODE
        Dim strMsg As String
        Dim dt As DataTable
        Dim dRow As DataRow
        Dim sMsg As String = ""
        Dim i As Integer

        objComputer = New Computer
        objComputer.Name = "."
        classComputer.Add(objComputer)
        typeStatus = STATUS_CODE.INPUT

        dt = WIN32_NetworkAdapterConfiguration(classComputer, typeStatus, strMsg)
        For Each dRow In dt.Rows
            For i = 0 To dt.Columns.Count - 1
                sMsg += dt.Columns(i).ColumnName & " : " & dRow(i) & "." & vbCrLf
            Next
        Next

    End Sub


    Private Sub showInformation()

        Dim objComputer As Computer
        Dim classComputer As New classComputer
        Dim typeStatus As STATUS_CODE
        Dim strMsg As String
        Dim dt As DataTable
        Dim dRow As DataRow
        Dim sMsg As String = ""
        Dim i As Integer

        objComputer = New Computer
        objComputer.Name = "."
        classComputer.Add(objComputer)
        typeStatus = STATUS_CODE.INPUT

        dt = WIN32_OperatingSystem(classComputer, typeStatus, strMsg)
        For Each dRow In dt.Rows

            txtOS.Text = dRow("Caption")
            txtVersion.Text = dRow("Version")
            txtManucfacturer.Text = dRow("Manufacturer")
            txtSerial.Text = dRow("SerialNumber")
            txtLocale.Text = dRow("Locale")

            txtFreeMem.Text = KBtoMB(dRow("FreePhysicalMemory"))

            For i = 0 To dt.Columns.Count - 1
                sMsg += dt.Columns(i).ColumnName & " : " & dRow(i) & "." & vbCrLf
            Next
        Next

    End Sub


End Class
